

def doublePoint(my_list):

    index = 0



    for i in my_list:

#       判断条件就是 满指针对应的索引位的值,跟快指针相等
#       相等:重复 ,不相等 慢指针走一步,并且赋值
        if my_list[index] == i:
            continue
        else:
            index+=1
            my_list[index] = i

    return my_list[:index+1]


def duplicate_removal(my_list):

    print('1')

    new_list = []

    for item in my_list:

        if len(new_list)==0:
            new_list.append(item)
            continue
        if new_list[len(new_list)-1]==item:
            continue
        else:
            new_list.append(item)
    return new_list
#                          a
my_list = [1,2,3,4,3,4,5,5,6]
#                b


# new_list  = duplicate_removal(my_list)

# print(new_list)

print(doublePoint(my_list))

